package com.pmgames.vo;

public class GameObject implements IXmlSerializable {

	private int id;
	private String name;
	private String URL;
	private String type;
	private String level;
	private Course course;
	private Module module;
	private String owner;
	
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getURL() {
		return URL;
	}

	public void setURL(String url) {
		URL = url;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}


	public Course getCourse() {
		return course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	public Module getModule() {
		return module;
	}

	public void setModule(Module module) {
		this.module = module;
	}

	public String getOwner() {
		return owner;
	}

	public void setOwner(String owner) {
		this.owner = owner;
	}

	public GameObject() {
		// TODO Auto-generated constructor stub
	}
	
	/* (non-Javadoc)
	* @see java.lang.Object#equals(java.lang.Object)
	*/
	@Override
	public boolean equals(Object arg0) {
		return this.id == ((GameObject)arg0).getId();
	}
	
	@Override
	public String toXml() {
		String xml = "<gameObject>";
		xml += "<id>" + id + "</id>";
		xml += "<name>" + name + "</name>";
		xml += "<URL>" + URL + "</URL>";
		xml += "<type>" + type + "</type>";
		xml += "<level>" + level + "</level>";
		xml += "<course>" + course.toXml() + "</course>";
		xml += "<module>" + module.toXml() + "</module>";
		xml += "<owner>" + owner + "</owner>";
		xml += "</gameObject>";
		return xml;
	}

}
